﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace LuceneIndexBuilder
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void btnCreateIndex_Click(object sender, RoutedEventArgs e)
        {
            string indexFileLocation = txtPath.Text.Trim();
            Lucene.Net.Store.Directory dir = Lucene.Net.Store.FSDirectory.GetDirectory(@indexFileLocation, true);

            Lucene.Net.Analysis.Analyzer analyzer = new Lucene.Net.Analysis.Standard.StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_CURRENT);

            Lucene.Net.Index.IndexWriter writer = new Lucene.Net.Index.IndexWriter(dir, analyzer, Lucene.Net.Index.IndexWriter.MaxFieldLength.LIMITED);
            

            MessageBox.Show("Indice creato!");
        }

        private void btnDeleteIndex_Click(object sender, RoutedEventArgs e)
        {

        }
    }
}
